import json

with open('wuhan_dialysis.json','r') as fr:
    all11 = json.loads(fr.read())['all']

with open('wuhan_emergency.json', 'r') as fr:
    all22 = json.loads(fr.read())['all']

with open('wuhan_tumor.json', 'r') as fr:
    all33 = json.loads(fr.read())['all']
all1 = []
all2 = []
all3 = []
for a in all11:
    if a['addr'] != '404':
        all1.append(a)
for a in all22:
    if a['addr'] != '404':
        all2.append(a)
for a in all33:
    if a['addr'] != '404':
        all3.append(a)
out = []

for item1 in all1:
    k = 0
    while k < len(all2):
        if item1['name_fmt'] == all2[k]['name_fmt']:
            del all2[k]
        else:
            k += 1
all = all1 + all2
print(len(all))

with open('wuhan22.json','w') as fw:
    fw.write(json.dumps({'all':all}, separators=(',',':'), ensure_ascii=False))
